<?php

error_reporting(E_ERROR);
ini_set("display_errors", 1);
#require_once "EmailAddress.inc";

require_once './PHPUnit/Framework/Test.php';
require_once './PHPUnit/Framework/SelfDescribing.php';
require_once './PHPUnit/Framework/TestListener.php';
require_once './PHPUnit/Runner/BaseTestRunner.php';
require_once './PHPUnit/Framework/Assert.php';
require_once './PHPUnit/Framework/TestSuite.php';
require_once './PHPUnit/Framework/TestCase.php';
require_once './PHPUnit/Framework/TestResult.php';
require_once './PHPUnit/Framework/AssertionFailedError.php';
require_once './PHPUnit/Framework/ExpectationFailedException.php';

require_once './PHPUnit/Framework/Constraint.php';
require_once './PHPUnit/Framework/TestFailure.php';
require_once './PHPUnit/Framework/Constraint/IsTrue.php';
require_once './PHPUnit/TextUI/TestRunner.php';
require_once './PHPUnit/Util/Printer.php';
require_once './PHPUnit/TextUI/ResultPrinter.php';
require_once './PHPUnit/Util/Test.php';
require_once './PHPUnit/Util/Type.php';
require_once './PHPUnit/Util/Filter.php';
require_once './PHPUnit/Util/GlobalState.php';
require_once './PHPUnit/Util/InvalidArgumentHelper.php';
require_once './PHPUnit/Util/DeprecatedFeature/Logger.php';
require_once './PHPUnit/Runner/Version.php';

//require_once './PHPUnit/Autoload.php' ;

require_once './tests/core/Db.php' ;
require_once './tests/core/SimpleQuery.php' ;

//require_once './tests/dummyTest.php' ;
//require_once './tests/emmailAddress.php' ;



//echo __FILE__."<br />";
//echo $_SERVER["PHP_SELF"]."----".realpath($_SERVER["PHP_SELF"]);
//if(realpath($_SERVER["PHP_SELF"]) == __FILE__) {
echo "<pre>" ;
	
$suite = new PHPUnit_Framework_TestSuite();

foreach ( new DirectoryIterator("./tests") as $fileinfo) {
  if ($fileinfo->isFile()) {
    echo "./tests/".$fileinfo->getFilename()."<br />" ;
      require_once( "./tests/".$fileinfo->getFilename() );
      //$suite->addTestSuite( $fileinfo->getBasename(".php") );
      echo $fileinfo->getBasename(".php"). "<br />";
  }
}
echo "----------------" ;

//$suite->addTestSuite( 'DummyTest' );
PHPUnit_TextUI_TestRunner::run($suite);

//}
?>